package com.truyensex.ui;

import com.truyensex.model.Article;

import info.androidhive.slidingmenu.R;
import android.app.Fragment;
import android.os.Bundle;
import android.text.method.ScrollingMovementMethod;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

public class ArticleFragment extends Fragment{
	private TextView tvContent;
	private TextView tvName;
	private Article article = null;
	public ArticleFragment(Article article) {
		this.article = article;
	}
	@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
            Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_article, container, false);
        tvContent = (TextView) rootView.findViewById(R.id.textView2);
        tvName = (TextView) rootView.findViewById(R.id.textView1);
        if(article!=null)
        {
        	tvName.setText(article.getName());
        	tvContent.setText(article.getContent());
        }
        tvContent.setMovementMethod(new ScrollingMovementMethod());
        return rootView;
    }

}
